// newmodels/statusChangeLogSchema.js
const mongoose = require('mongoose');

///机器状态修改历史表

const statusChangeLogSchema = new mongoose.Schema({
  machineId: { type: mongoose.Schema.Types.ObjectId, ref: 'Machine', required: true }, // 机器信息表的ID
  userName: { type: String, required: true }, // 用户姓名
  operationInfo: { type: String, required: true }, // 操作信息
  createdAt: { type: Date, default: Date.now }, // 创建时间，默认为当前时间
  updatedAt: { type: Date, default: Date.now } // 修改的时间，默认为当前时间
});

module.exports = mongoose.model('StatusChangeLog', statusChangeLogSchema);